<%--
  Created by IntelliJ IDEA.
  User: 77869
  Date: 2022/11/15
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品信息查询</title>
    <%@ include file="header.jsp" %>
</head>
<body>

<a class="btn btn-primary" href="${path}/goods_add.jsp">添加</a>
<table class="table table-striped table-bordered  table-hover">
    <tr>
        <td>商品ID</td>
        <td>商品名</td>
        <td>商品规格</td>
        <td>商品价格</td>
        <td>修改</td>
        <td>删除</td>

    </tr>
    <c:forEach items="${good_list}" var="good">
        <tr>
            <td>${good.good_id}</td>

            <td>${good.good_name}</td>
            <td>${good.good_spec}</td>
            <td>${good.good_price}</td>

            <td><a href="${path}/goods?method=selectById&good_id=${good.good_id}">修改</a></td>
            <td><a href="javascript:delectById(${good.good_id})">删除</a></td>

        </tr>
    </c:forEach>

</table>
<script>
    function delectById(id) {
        layer.confirm("您确定要删除吗？", function () {
            location.href = ("${path}/goods?method=deleteById&good_id=" + id)
        })
    }
</script>
</body>
</html>
